<template>
    <div class="error" @touchstart.stop>
        <div class="content">
            <img class="icon" :src="ErrorIcon" />
            <h2>Error 404</h2>
            <h3>您访问的页面未找到，{{count_down}}秒后自动返回</h3>
        </div>
    </div>
</template>

<script>
import ErrorIcon from '@a/images/error-icon.svg'
let ErrorBackCountDownTimer = null
export default {
    name: "error_404",
    data (){
        return {
            ErrorIcon,
            count_down: 5
        }
    },
    mounted() {
        clearInterval(ErrorBackCountDownTimer)
        ErrorBackCountDownTimer = setInterval(() => {
            if(this.count_down > 1){
                this.count_down --
            } else {
                this.$router.go(-1)
            }
        },1000)
    },
    beforeDestroy() {
        clearInterval(ErrorBackCountDownTimer)
    }
}
</script>

<style scoped lang="less" src="./error.less"></style>
